Skip to content

Conversation

@0xmichalis
Copy link
Contributor

Commands I have defaulted using the builder/RESTMapper in this PR:

  • oc deploy
    (Was using both syntaxes before, now achieves it via the resource builder.)
  • oadm build-chain
    (Was using both syntaxes before, now achieves it via the RESTMapper.)
  • oc start-build
    (Was using only NAME syntax, now uses bc/NAME too.)
  • oadm secrets add
    (Was using only TYPE/NAME syntax, now uses NAME too.)
  • oc cancel-build
    (Was using only NAME syntax, now uses build/NAME too.)

@smarterclayton @fabianofranz

Fixes #4781
Fixes #1995

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lowercase?

@deads2k
Copy link
Contributor

deads2k commented Oct 6, 2015

@liggitt
Copy link
Contributor

liggitt commented Oct 6, 2015

This command is requiring resource/name format: https://github.com/openshift/origin/blob/master/pkg/cmd/cli/secrets/add_secret_to_obj.go

For two args, no less

@0xmichalis 0xmichalis closed this Oct 10, 2015
@0xmichalis 0xmichalis reopened this Oct 10, 2015
@0xmichalis
Copy link
Contributor Author

[test]

@0xmichalis
Copy link
Contributor Author

@deads2k jenkins is green, merge at your will

@liggitt
Copy link
Contributor

liggitt commented Oct 10, 2015

Are there tests to make sure prior invocations still work correctly?

@0xmichalis
Copy link
Contributor Author

Are there tests to make sure prior invocations still work correctly?

test-cmd.sh should catch such errors.

@liggitt
Copy link
Contributor

liggitt commented Oct 10, 2015

I agree it should, just not sure it does :)
Can you summarize what invocations were allowed prior (with/without types, abbreviations and full resource names), and what are allowed now?
For example, abbreviations like oc secrets add sa/sa-name ... were allowed, but I don't think test-cmd.sh exercises that

@0xmichalis
Copy link
Contributor Author

Can you summarize what invocations were allowed prior (with/without types, abbreviations and full resource names), and what are allowed now?

I've updated the first post with more details about and I've also updated test-cmd to test all cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like something that should be handled by resource builder?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not using the resource builder here because it would try to get the buildConfig (which we are not interested in) in order to start the build. Instead, I think using the RESTMapper to resolve the resource type is enough.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes me believe that what you are representing here is a common pattern
that should be abstracted either into resource.Builder (but without the
fetch) or as supporting utility code in the cmd packages.

On Oct 11, 2015, at 3:38 PM, Michail Kargakis [email protected]
wrote:

In pkg/cmd/cli/cmd/startbuild.go
#4947 (comment):

name := buildName
isBuild := true

  • if len(name) == 0 {
  • name = args[0]
    
  • if len(name) == 0 && len(args[0]) > 0 {
  • parts := strings.Split(args[0], "/")
    

I am not using the resource builder here because it would try to get the
buildConfig (which we are not interested in) in order to start the build.
Instead, I think using the RESTMapper to resolve the resource type is
enough.


Reply to this email directly or view it on GitHub
https://github.com/openshift/origin/pull/4947/files#r41714535.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an utility under origin/pkg/cmd/util to handle this.

@0xmichalis
Copy link
Contributor Author

re[test]

@0xmichalis
Copy link
Contributor Author

go stdlib race

rere[test]

@0xmichalis
Copy link
Contributor Author

Tagging more eyes:

@ironcladlou about deploy
@mfojtik about {start,cancel}-build

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what you really want is a way to get a canonical resource representation. Something where you get "imagestreamtag" back for "istag", "istags", "imagestreamtags" in any case. If multiple resources deal in the same kind, this breaks because "notAnIsTag/foo" would match.

I asked @smarterclayton if he knew whether it existed, he said he'd look for it/make it.

@0xmichalis
Copy link
Contributor Author

[test]

@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 22, 2015
@smarterclayton
Copy link
Contributor

[test]

@smarterclayton
Copy link
Contributor

Test flake in #5410

On Sat, Oct 24, 2015 at 6:00 PM, OpenShift Bot [email protected]
wrote:

Origin Action Required: Pull request cannot be automatically merged,
please rebase your branch from latest HEAD and push again


Reply to this email directly or view it on GitHub
#4947 (comment).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't you need to make sure you got back a non-empty name? I would do so after this block, to catch the case where len(args[0]) == 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@liggitt
Copy link
Contributor

liggitt commented Oct 27, 2015

one question on fromRepo, fromFile, etc interaction from @smarterclayton, then lgtm

@smarterclayton
Copy link
Contributor

if len(args) > 0 || len(buildName) > 0 || len(fromFile) > 0 || len(fromDir) > 0 || len(fromRepo) > 0 {

we're safe.

On Tue, Oct 27, 2015 at 4:32 PM, Jordan Liggitt [email protected]
wrote:

one question on fromRepo, fromFile, etc interaction from @smarterclayton
https://github.com/smarterclayton, then lgtm


Reply to this email directly or view it on GitHub
#4947 (comment).

@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 29, 2015
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this check outside the if block to catch cases where len(name)==0, but len(args[0]) == 0, for example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to e30dccd

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/6430/)

@0xmichalis 0xmichalis closed this Oct 30, 2015
@0xmichalis 0xmichalis reopened this Oct 30, 2015
@liggitt
Copy link
Contributor

liggitt commented Oct 31, 2015

LGTM, ready to merge?

@0xmichalis
Copy link
Contributor Author

Lets do it

@liggitt
Copy link
Contributor

liggitt commented Oct 31, 2015

[merge]

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/3879/) (Image: devenv-rhel7_2614)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to e30dccd

openshift-bot pushed a commit that referenced this pull request Oct 31, 2015
@openshift-bot openshift-bot merged commit 9501700 into openshift:master Oct 31, 2015
@0xmichalis 0xmichalis deleted the default-resources-in-commands branch October 31, 2015 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants